Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly disable CGO in .goreleaser.yml #113

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Explicitly disable CGO in .goreleaser.yml #113

merged 1 commit into from
Feb 4, 2025

Conversation

justinvp
Copy link
Member

@justinvp justinvp commented Feb 4, 2025

In other repos, we've run into problems when the runner used to publish builds switched from macOS to Ubuntu because CGO is disabled by default on macOS but enabled on Ubuntu, and when CGO is enabled, by default the built binary will be dynamically linked. We want statically linked files on Linux so the binary works across different OSes.

This commit preemptively explicitly disables CGO in .goreleaser.yml and .goreleaser.prerelease.yml to ensure the binaries remain statically linked if/when the GHA runner is changed to Ubuntu.

Reference: pulumi/pulumi-yaml#657

Fixes #112

In other repos, we've run into problems when the runner used to publish builds switched from macOS to Ubuntu because CGO is disabled by default on macOS but enabled on Ubuntu, and when CGO is enabled, by default the built binary will be dynamically linked. We want statically linked files on Linux so the binary works across different OSes.

This commit preemptively explicitly disables CGO in `.goreleaser.yml` and `.goreleaser.prerelease.yml` to ensure the binaries remain statically linked if/when the GHA runner is changed to Ubuntu.
@justinvp justinvp added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Feb 4, 2025
@justinvp justinvp requested a review from a team February 4, 2025 02:20
@lunaris lunaris merged commit 85a4279 into main Feb 4, 2025
5 checks passed
@lunaris lunaris deleted the justin/cgo branch February 4, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable CGO in .goreleaser.yml files
3 participants